using UnityEngine;
using System.Collections;

public class 			e_server
{
	public static 		e_server 	instance;
	
	public 				e_server 	()
	{
		edict			= new Hashtable();
		instance		= this;
	}
	
	public void 		register		(entity e)
	{
		edict.Add		(e.GetInstanceID(), e);
		Debug.Log		("registered entity " + e.GetInstanceID());
	}
	
	public void			unregister		(entity e)
	{
		edict.Remove		(e.GetInstanceID());
		GameObject.Destroy	(e.gameObject);
	}
	
	public entity		find			(int id)
	{
		return 			(entity) edict[id];
	}
	
	private Hashtable	edict;
}
